package com.miaosha.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.miaosha.entity.MiaoShaGoods;
import com.miaosha.entity.vo.OrderVo;
import com.miaosha.utils.CommonResult;

import java.util.List;


public interface MiaoShaGoodsService extends IService<MiaoShaGoods> {

    /**
     * 获取正在秒杀的商品
     *
     * @return
     */
    List<MiaoShaGoods> listAllNow();

    /**
     * 根据id查找
     *
     * @param id
     * @return
     */
    MiaoShaGoods findById(Integer id);

    /**
     * 修改秒杀商品
     *
     * @param miaoShaGoods
     * @return
     */
    int update(MiaoShaGoods miaoShaGoods);

    void add2Redis(MiaoShaGoods miaoShaGoods);

    void removeRedis(Long[] miaoShaGoodsIds);

    CommonResult<String> doSeckill(Integer miaoShaGoodsId, Long userId);
}
